/*    */ package com.qmsk.business.qrcode.controller;
/*    */ 
/*    */ import com.qmsk.business.qrcode.service.QrCodeService;
/*    */ import com.utils.jdbc.connection.DbConnection;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import org.apache.log4j.Logger;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Controller;
/*    */ import org.springframework.web.bind.annotation.PathVariable;
/*    */ import org.springframework.web.bind.annotation.RequestMapping;
/*    */ 
/*    */ @Controller
/*    */ @RequestMapping({"qrcode"})
/*    */ public class QrCodeController
/*    */ {
/* 18 */   private Logger logger = Logger.getLogger(QrCodeController.class);
/*    */ 
/*    */   @Autowired
/*    */   private QrCodeService service;
/*    */ 
/*    */   @RequestMapping({"scan/{openId}/{sceneId}"})
/*    */   public void scan(HttpServletRequest request, HttpServletResponse response, @PathVariable("openId") String openId, @PathVariable("sceneId") String sceneId)
/*    */   {
/*    */     try
/*    */     {
/* 28 */       this.service.recordScan(openId, sceneId);
/*    */     }
/*    */     catch (Exception e)
/*    */     {
/* 33 */       DbConnection.rollback();
/* 34 */       this.logger.error("二维码扫描错误，错误信息：" + e.getMessage());
/*    */     }
/*    */   }
/*    */ 
/*    */   @RequestMapping({"subscribe/{openId}/{sceneId}"})
/*    */   public void subscribe(HttpServletRequest request, HttpServletResponse response, @PathVariable("openId") String openId, @PathVariable("sceneId") String sceneId)
/*    */   {
/*    */     try
/*    */     {
/* 44 */       sceneId = sceneId.substring(8);
/*    */ 
/* 46 */       this.service.recordSubscribe(openId, sceneId);
/*    */     }
/*    */     catch (Exception e)
/*    */     {
/* 51 */       DbConnection.rollback();
/* 52 */       this.logger.error("二维码关注错误，错误信息：" + e.getMessage());
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
 * Qualified Name:     com.qmsk.business.qrcode.controller.QrCodeController
 * JD-Core Version:    0.5.3
 */